package com.pzr.soccer.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @Author pzr
 * @date:2021-12-21-16:28
 * @Description:
 **/
@RestController
@RequestMapping("/other")
public class OtherController {

    @GetMapping("/currentUser")
    public Object getCurrentUserInfo(){

        return  SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
